<?php use_helper('Javascript'); ?>

<h3>Tri des photos de la gallerie <strong><?php echo $gallery->getTitle() ?></strong></h3>

<p>
 <?php echo link_to('&lt;&lt; sauvegarder l\'ordre', 'gallery/index') ?>&nbsp; 
</p>

<div id="sf_admin_container" class="clearfix">

  <div id="sorter">
  <?php if ($pictures): ?>
  <ul id="order">
    <?php foreach ($pictures as $picture): ?>
    <li id="item_<?php echo $picture->getId() ?>" class="sortable">
      <?php echo image_tag('/admin/uploads/galleries/gallery_'.$gallery->getId().'/thumbnail/'.$picture->getPath()) ?>
    </li>
    <?php endforeach; ?>
  </ul>
  <?php endif; ?>
  </div>

</div>

<?php echo sortable_element('order', array(
  'url'    => 'gallery/savePictureOrder',
  'update' => 'feedback',
  'only'   => 'sortable',
)) ?>